package com.websuites.esb.repository;

import java.util.HashMap;
import java.util.Iterator;

@SuppressWarnings("unchecked")
public class Param
{
	private String sName;
	private String sType;
	private String sSource;
	private String sFrom = "request";
	private String sTrans;
	private String sValue = "";
	private HashMap mapProps = new HashMap();
	
	public String getName()
	{
		return sName;
	}
	public void setName(String sName)
	{
		this.sName = sName;
	}
	public String getSource() 
	{
		return this.sSource;
	}
	
	public void setSource(String sSource) 
	{
		this.sSource = sSource;
	}
	public String getType()
	{
		return sType;
	}
	public void setType(String sType)
	{
		this.sType = sType;
	}
	public String getFrom()
	{
		return sFrom;
	}
	public void setFrom(String sFrom)
	{
		if (sFrom != null && !("").equals(sFrom))
		{
			this.sFrom = sFrom;
		}
	}
	public String getTrans()
	{
		return sTrans;
	}
	public void setTrans(String sTrans)
	{
		this.sTrans = sTrans;
	}
	public String getValue()
	{
		return sValue;
	}
	public void setValue(String sValue)
	{
		this.sValue = sValue;
	}
	public void setPropValue(String sPropKey, String sPropValue)
	{
		mapProps.put(sPropKey, sPropValue);
	}
	public String getPropValue(String sPropKey)
	{
		if (mapProps.containsKey(sPropKey))
		{
			return (String)mapProps.get(sPropKey);
		}
		else
		{
			return null;
		}
	}
	public Iterator getPropIterator()
	{
		return mapProps.entrySet().iterator();
	}
	public void setProps(HashMap mapProps)
	{
		this.mapProps = mapProps;
	}
}
